﻿using System.Web.Mvc;
using LogikBug.ModularMvc;
using LogikBug.ModularMvc.Navigation;
using LogikBug.ModularMvc.Registration;

namespace Test.Modules.Locations
{
	public class LocationModule : VisualModule
	{
		#region Constructors

		public LocationModule()
		{
			Name = "Location Management";
			OrderPrecedence = 5.0m;
			MenuDisplayOrder = 1;
		}

		#endregion

		#region Methods

		#region ModuleBase Members

		protected override void Initialize(IRegistrationContext context)
		{
			context.Routes.MapRoute(
				this,
				"LocationsAjaxRoute",
				"ajax/{action}/location",
				new { controller = "ajax", action = "index" },
				new[] { "Test.Modules.Locations.Controllers" }
			);
			context.Routes.MapRoute(
				this,
				"LocationsDefaultRoute",
				"location/{action}/{id}",
				new { controller = "location", action = "manage", id = UrlParameter.Optional },
				new[] { "Test.Modules.Locations.Controllers" }
			);
			context.Routes.MapRoute(
				this,
				"WebsiteDefaultRoute",
				"websites/{action}/{id}",
				new { controller = "websites", action = "manage", id = UrlParameter.Optional },
				new[] { "Test.Modules.Locations.Controllers" }
			);
		}

		#endregion

		#region VisualModuleBase Members

		public override MenuItemCollection GetMenu(ViewContext viewContext, MenuType menuType)
		{
			return null;
		}

		#endregion

		#endregion
	}
}
